package java_zuoye_3;

import java.util.ArrayList;
import java.util.Random;

public class player {
	private String name;
	private int money;
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public int getMoney() {
		return money;
	}
	public void setMoney(int money) {
		this.money = money;
	}
	public player() {
		
	}
	public player(String name, int money) {
		this.money = money;
		this.name = name;
	}
	public void receive(ArrayList<Integer> list) {
		int index = new Random().nextInt(list.size());
		int delta = list.remove(index);
		this.setMoney(this.money + delta);
	}
	public void show() {
		System.out.println("我叫" + name + ", 我有" + money);
	}
}
